package top.chendawei.demo.system.mapper

import org.springframework.data.domain.Page
import org.springframework.data.domain.Pageable
import org.springframework.data.jpa.repository.JpaRepository
import org.springframework.stereotype.Repository
import top.chendawei.demo.system.entity.Demo
import java.util.*

@Repository
interface DemoRepository : JpaRepository<Demo, Long> {

    // Kotlin 特有 Optional 处理
    fun findByEmail(email: String): Optional<Demo>

    // 动态查询示例
    fun findByNameContainingIgnoreCase(name: String, pageable: Pageable): Page<Demo>
}